home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / datafiles / gfx_formats / hdf / hdfs.apa < prev    next >
Text File  |  1995-02-13  |  20KB  |  713 lines

  1.  
  2.  
  3. Appendix  A    NCSA HDF Tags
  4.  
  5.  
  6.  
  7.  
  8. Overview
  9.  
  10. This appendix contains a complete description of HDF tags that 
  11. have been assigned at NCSA as of February, 1989. Most of these 
  12. tags are represented by two- or three-character uppercase names, 
  13. such as ND or FID. In the NCSA software, the identifiers that refer 
  14. to these names are preceded by DFTAG_ and are defined in the 
  15. files df.h and dfF.h, which are listed in Appendix B.
  16.  
  17. These listings are grouped approximately according to the roles 
  18. that the tags play under the headings Utility Tags, Raster-8 Tags, 
  19. General Raster Image Tags, and so forth. These groupings imply 
  20. a general context for the use of each tag, but are not meant to restrict 
  21. the use of the tags to any particular context.
  22.  
  23.  
  24. Utility Tags
  25.  
  26. ND
  27. No data
  28. 0 bytes
  29. (xxx)
  30.  
  31. This tag is used for place holding and to fill empty portions of the 
  32. data descriptor block. The length and offset fields of a ND DD must 
  33. be equal to zero.
  34.  
  35.  
  36. FID
  37. File identifier
  38. string
  39. (100)
  40.  
  41. This tag points to a string which the user wants to associate with 
  42. this file. The string is intended to be a user-supplied title for the 
  43. file. 
  44.  
  45.  
  46.  
  47. FD
  48. File descriptor
  49. text
  50. (101)
  51.  
  52. This tag points to a block of text describing the overall file 
  53. contents. The text can be any length, in the standard text format for 
  54. HDF. Text is intended to be user-supplied comments about the file.
  55.  
  56.  
  57. TID
  58. Tag identifier
  59. string
  60. (102)
  61.  
  62. The data for this tag is a string that identifies the functionality of 
  63. the tag indicated in the reference number. For example, the tag 
  64. identifer for tag identifier would point to data that reads "tag 
  65. identifier". The reference number for the tag identifier is another 
  66. tag number.
  67.  
  68. Many tags are identified in the HDF specification, so it is usually 
  69. unnecessary to include their identifiers in the HDF file. But with 
  70. user-defined tags or special-purpose tags, the only way for a 
  71. human reader to diagnose what kind of data is stored in a file is to 
  72. read tag identifiers. Use tag descriptors to define even more detail 
  73. about your user-defined tags.
  74.  
  75. Note that with this tag you may make use of the user-defined tags to 
  76. check for consistency. Although two persons may use the same 
  77. user-defined tag, they probably will not use the same tag identifier.
  78.  
  79.  
  80. TD
  81. Tag descriptor
  82. text
  83. (103)
  84.  
  85. The data for this tag is a text block which describes in relative 
  86. detail the functionality and format of the tag which is indicated in 
  87. the reference number. This tag is mainly intended to be used with 
  88. user-defined tags and provides a medium for users to exchange 
  89. files that include human-readable descriptions of the data.
  90.  
  91. It is important to provide everything that a programmer might 
  92. need to know to read the data from your user-defined tag. At the 
  93. minimum, you should specify everything you would need to know 
  94. in order to retrieve your data at a later date if the original program 
  95. were lost.
  96.  
  97.  
  98.  
  99. DIL
  100. Data identifier label
  101. string
  102. (104)
  103.  
  104. The data for this tag is a data identifier, made up of a tag and 
  105. reference number, followed by a string that the user wants to place 
  106. in the file. The purpose of this tag is to associate the string with the 
  107. data identifier as a label for whatever that data identifier points to 
  108. in turn.
  109.  
  110. With DIL, any data identifier can be labeled. Each data identifier 
  111. points to some data in the file. By including DILs, you can give 
  112. any piece of data a label for future reference. For example, DIL is 
  113. often used to give titles to images.
  114.  
  115.  
  116. DIA
  117. Data identifier annotation
  118. text
  119. (105)
  120.  
  121. The data for this tag is a data identifier, which is made up of a tag 
  122. and a reference number, followed by a text block that the user 
  123. wants to place in the file. Its purpose is to associate the text block 
  124. with the data identifier as annotation for whatever that data 
  125. identifier points to in turn.
  126.  
  127. With DIA, any data identifier can have a lengthy, user-written 
  128. description of why that data is in the file. This will be used to 
  129. include user comments about images, data sets, source code, and so 
  130. forth.
  131.  
  132.  
  133. NT
  134. Number type
  135. 4 bytes
  136. (106)
  137.  
  138. NT consists of four fields of 1 byte each, as shown in Table A.1.
  139.  
  140. Table A.1    Number Type Fields
  141. Field    Contents
  142. VERSION    version number of NT information, currently=1
  143. TYPE    unsigned int, signed int, unsigned char, char, float, 
  144. double
  145. WIDTH    number of bits (assumed all significant)
  146. CLASS    a generic value, with different interpretations 
  147. depending on type:  floating point, integer, or 
  148. character
  149.  
  150.  
  151. Some possible values that may be included for each of the three 
  152. types in the field CLASS are listed in Table A.2.
  153.  
  154. Table A.2    Number Type 
  155. Values
  156. Type    Possible Values
  157. floats     IEEE floating point, VAX floating point, CRAY 
  158. floating point
  159. ints    VAX byte order, Intel byte order, Motorola byte order
  160. chars    ASCII, EBCDIC
  161.  
  162.  
  163. The number type flag is used by any other element in the file to 
  164. indicate specifically what a numeric value looks like. Other tag 
  165. types should contain a reference number pointer to an NT tag 
  166. instead of containing their own number type definitions.
  167.  
  168. If an MT element is present in the file, then all NTs can be 
  169. assumed to be of the appropriate default types for that machine, 
  170. unless required by definition.
  171.  
  172. The definition of NT has brought up a unique situation where the 
  173. definition of a generic, always applicable, set of fields is 
  174. considered too difficult for implementation in the early versions. 
  175. Therefore, we are defining version 1 of the NT tag which contains 
  176. only four fields. We have a draft of the version 2 tag definition 
  177. which starts with the same four fields and adds fields that can 
  178. define types of numbers not currently listed.
  179.  
  180. Version 1 NT implementations should check the version number 
  181. field only to confirm it, and must always write a 1 into this field. 
  182. Version 2 implementations will have to be backward compatible in 
  183. as many cases as possible.
  184.  
  185.  
  186. MT
  187. Machine type
  188. 0 bytes
  189. (107)
  190.  
  191. The MT tag specifies that all unconstrained or partially 
  192. constrained values in this HDF file are of the default type for that 
  193. hardware. When the MT tag is set to VAX, for example, all 
  194. integers will be assumed to be in VAX byte order unless 
  195. specifically defined otherwise with an NT tag. Note that all of the 
  196. headers and many tags, the whole raster-8 set for example, are 
  197. defined with bit-wise precision and will not be overidden by the 
  198. MT setting.
  199.  
  200. For MT, the reference field itself is the encoding of the MT 
  201. information. The reference field is 16 bits, taken as four groups of 
  202. four bits, specifying the types for unsigned char, unsigned int, 
  203. float, and double respectively. This allows 16 generic 
  204. specifications for each type.
  205.  
  206. To the user, these will be defined constants in df.h, specifying the 
  207. proper descriptive numbers for Sun, VAX, CRAY, Alliant, and 
  208. other computer systems. If there is no MT tag in a file, the 
  209. application may assume that the data in the file has been written on 
  210. the local machineÑassuming any portability problems are taken 
  211. care of by the user. For this reason, we recommend that all HDF 
  212. files contain an MT tag for maximum portability.
  213.  
  214. Possible machine types are shown in Table A.3.
  215.  
  216. Table A.3    Possible Machine 
  217. Types
  218. Type    Possible Machines
  219. floats    IEEE32, VAX32, CRAY64
  220. ints    VAX32, Intel16, Intel32, Motorola32, CRAY64
  221. chars    ASCII, EBCDIC
  222. double    IEEE64, VAX64, CRAY128
  223.  
  224. Obviously, each of these is extensible as we find a need for new 
  225. types.
  226.  
  227.  
  228. RLE
  229. Run length encoded data
  230. 0 bytes
  231. (11)
  232.  
  233. This tag is used in the ID compression field and other places to 
  234. indicate that an image or section of data is encoded with a run-
  235. length encoding scheme. The RLE method used is byte-wise. The 
  236. low seven bits of the count byte indicate the number of bytes (n). 
  237. The high bit of the count byte indicates whether the next byte should 
  238. be replicated n times (high bit=1), or whether the next n bytes should 
  239. be included as is (high bit=0).
  240.  
  241. See also:  RIG (Raster Image Group)
  242.  
  243.  
  244. IMC
  245. IMCOMP compressed data
  246. 0 bytes
  247. (12)
  248.  
  249. This tag is used in the ID compression field and other places to 
  250. indicate that an image or section of data is encoded with an 
  251. IMCOMP encoding scheme. This scheme is a 4:1 aerial averaging 
  252. method which is easy to decompress. It counts color frequencies in 
  253. 4x4 squares to optimize color sampling.
  254.  
  255. See also:  RIG (Raster Image Group)
  256.  
  257.  
  258.  
  259. Raster-8 (8-Bit Only) Tags
  260.  
  261. ID8
  262. Image dimension-8
  263. 4 bytes
  264. (200)
  265.  
  266. The data for this tag consists of two 16-bit integers representing the 
  267. width and height of an 8-bit raster image in bytes. 
  268.  
  269.  
  270. IP8
  271. Image palette-8
  272. 768 bytes
  273. (201)
  274.  
  275. The data for this tag consists of 256 triples of three bytes. The bytes 
  276. are for the red, green, and blue elements of the 256-byte palette 
  277. respectively. The first triple is palette entry 0 and the last is palette 
  278. entry 255.
  279.  
  280.  
  281. RI8
  282. Raster image-8
  283. mxn bytes
  284. (202)
  285.  
  286. The data for this tag is a row-wise representation of the elementary 
  287. 8-bit image data. The data is stored width-first (hence row-wise) 
  288. and is 8-bits per pixel. The first byte of data represents the pixel in 
  289. the upper-left hand corner of the image.
  290.  
  291.  
  292. CI8
  293. Compressed image-8
  294. ? bytes
  295. (203)
  296.  
  297. The data for this tag is a row-wise representation of the elementary 
  298. 8-bit image data. Each row is compressed using the following run-
  299. length encoding where n is the low seven bits of the byte. The high 
  300. bit represents whether the following n character will be reproduced 
  301. exactly (high bit=0) or whether the following character will be 
  302. reproduced n times (high bit=1). Since CI8 and RI8 are basically 
  303. interchangeable, it is suggested that you not have a CI8 and a RI8 
  304. that have the same reference number.
  305.  
  306.  
  307. II8
  308. IMCOMP image-8
  309. ? bytes
  310. (xxx)
  311.  
  312. The data for this tag is a 4:1 compressed 8-bit image, using the 
  313. IMCOMP compression scheme.
  314.  
  315.  
  316. General Raster Image Tags
  317.  
  318. RIG
  319. Raster image group
  320. n*4 bytes
  321. (306)
  322.  
  323. The raster image group (RIG) data is a list of data identifiers 
  324. (tag/ref) that describe a raster image. All of the members of the 
  325. group are required to display the image correctly. Application 
  326. programs that deal with RIGs should read all the elements of a RIG 
  327. and process those identifiers which it can display correctly. Even 
  328. if the application cannot process all of the tags, the tags that it can 
  329. process will be displayable.
  330.  
  331. Tag types that may appear in a RIG are listed in Table A.4.
  332.  
  333. Table A.4    Possible Tag Types 
  334. in an RIG
  335. Tag    Description
  336. ID    image dimension
  337. RI    raster image
  338. XYP    X-Y position
  339. LD    LUT dimension
  340. LUT    color lookup table
  341. MD    matte channel dimension
  342. MA    matte channel
  343. CCN    color correction
  344. CFM    color format
  345. AR    aspect ratio
  346. MTO    machine-type override
  347.  
  348.  
  349. Example
  350. ID,RI,LD,LUT
  351. An image dimension record, the raster image, an LUT dimension 
  352. and the LUT go together. The application reads the image 
  353. dimensions, then reads the image with those dimensions. It also 
  354. reads the lookup table according to its dimensions and displays the 
  355. corresponding image.
  356.  
  357.  
  358. ID, LD, MD
  359. Image dimension
  360. 20 bytes
  361. (300)
  362.  
  363. LUT dimension
  364. 20 bytes
  365. (307)
  366.  
  367. Matte dimension
  368. 20 bytes
  369. (308)
  370.  
  371. These three dimension records have exactly the same format. 
  372. They define the dimensions of the 2D array to which each refers. 
  373. ID specifies the dimensions of an RI tag, LD specifies the 
  374. dimensions of an LUT tag, and MD specifies the dimensions of a 
  375. MA tag. The fields are defined as shown in Table A.5.
  376.  
  377. Table A.5    Dimension Record 
  378. Fields
  379. Field    Definition
  380. X-dimension (width)    32 bit integer
  381. Y-dimension (height)    32 bit integer
  382. NT/ref (element type)    tag and ref=32 bits
  383. Elements per node    16 bit integer
  384. Interlace scheme    16 bit integer (0,1 or 2)
  385. Compression tag    tag and ref=32 bits
  386.  
  387.  
  388. For example, a 512x256 row-wise 24-bit raster image with each 
  389. pixel stored as RGB bytes would have the following values:
  390.  
  391. X:512, Y:256
  392.  
  393. In this case, NT specifies an 8-bit integer. There are three 
  394. elements per nodeÑone each for red, green, and blue.
  395.  
  396. Interlace=0 indicates that the RGB values are not separated.
  397. Compression=0 means no compression scheme is used.
  398.  
  399.  
  400. RI
  401. Raster image
  402. x*y bytes
  403. (302)
  404.  
  405. This tag points to raster image data. It must be stored as specified 
  406. in an ID tag.
  407.  
  408. Interlace=0 means each pixel is contiguous
  409. Interlace=1 means each element is grouped by scan lines
  410. Interlace=2 means each element is grouped by planes
  411.  
  412.  
  413. LUT
  414. Lookup table
  415. ? bytes
  416. (301)
  417.  
  418. The LUT, sometimes called a palette, is used by many kinds of 
  419. hardware to assign RGB colors or HSV colors to data values. 
  420. When a raster image consists of data values which are going to be 
  421. interpreted through hardware with a LUT capability, the LUT 
  422. should be loaded along with the image.
  423.  
  424. The most common lookup table will have X dimension=256 and Y 
  425. dimension=1 with three elements per entry, one each for red, 
  426. green, and blue. The interlace will be either 0, where the LUT 
  427. values are given RGB, RGB, RGB . . . , or 1, where the LUT values 
  428. are given as 256 reds, 256 greens, 256 blues.
  429.  
  430.  
  431.  
  432. CCN
  433. Color correction
  434. 52 bytes (usually)
  435. (310)
  436.  
  437. Color correction specifies the Gamma correction for the image and 
  438. color primaries for the generation of the image. The fields, in 
  439. order, are shown in Table A.6.
  440.  
  441. Table A.6    Color Correction 
  442. Field Types
  443. Correction    Field Type
  444. Gamma    float
  445. Red (X,Y,Z)    three floats
  446. Green (X,Y,Z)    three floats
  447. Blue (X,Y,Z)    three floats
  448. White (X,Y,Z)    three floats
  449. CFM
  450. Color format
  451. string
  452. (311)
  453.  
  454. The color format is a clue to how each element of each pixel in a 
  455. raster image. It is defined to be a string which is in all caps, and is 
  456. one of the values shown in Table A.7.
  457.  
  458. Table A.7    Color Format String 
  459. Values
  460. String    Description
  461. VALUE    psuedo-color, or just a value associated with the 
  462. pixel
  463. RGB    red, green, blue model
  464. XYZ    color-space model
  465. HSV    hue, saturation, value model
  466. HSI    hue, saturation, intensity
  467. SPECTRAL    spectral sampling method
  468.  
  469.  
  470. AR
  471. Aspect ratio
  472. 4 bytes
  473. (312)
  474.  
  475. The data for this tag is the visual aspect ratio for this image. The 
  476. image should be visually correct if displayed on a screen with this 
  477. aspect ratio. The data consists of one floating point number which 
  478. represents width divided by height. An aspect ratio of 1.0 indicates 
  479. a display with perfectly square pixels. 1.33 is a standard aspect 
  480. ratio used by many monitors. 
  481.  
  482.  
  483.  
  484. Composite Image Tag
  485.  
  486. DRAW
  487. Draw
  488. n*4 bytes
  489. (400)
  490.  
  491. The data for this tag is a list of data identifiers (tag/ref) which 
  492. define a composite image. Each member of the DRAW data should 
  493. be displayed, in order, on the screen. This can be used to indicate 
  494. several RIGs which should be displayed simultaneously, or even 
  495. include vector overlays, like T14, which should be placed on top of a 
  496. RIG.
  497.  
  498. Some of the elements in a DRAW list will be instructions about 
  499. how images are to be composited (XOR, source put, anti-aliasing, 
  500. etc.). These are defined as individual tags.
  501.  
  502. See also:
  503.  
  504. RIG    (Raster image display)
  505. T14    (Tektronix 4014 for overlay)
  506.  
  507.  
  508. Composite Raster Image Tag
  509.  
  510. XYP
  511. XY position
  512. 8 bytes
  513. (500)
  514.  
  515. An XY position is used in composites and other groups to indicate 
  516. an XY position on the screen. For this, (0,0) is the lower left, X is the 
  517. number of pixels to the right along the horizontal axis and Y is the 
  518. number of pixels on the vertical axis. The X and Y pixel 
  519. dimensions are given as two 32-bit integers.
  520.  
  521. For example, if XYP is present inside an RIG, the XYP refers to the 
  522. position of the lower left corner of the raster image on the screen.
  523.  
  524. See also:  DRAW (Drawing from a list of elements)
  525.  
  526.  
  527.  
  528. Vector Image Tags
  529.  
  530. T14
  531. Tektronix 4014
  532. n bytes
  533. (602)
  534.  
  535. This tag points to a Tektronix 4014 data stream. The bytes in the 
  536. data field, when read and sent to a Tektronix 4014 terminal, will 
  537. display a vector image. Only the low seven bits of each byte are 
  538. significant. There are no record markings or non-Tektronix 
  539. codes in the data.
  540.  
  541.  
  542. T105
  543. Tektronix 4105
  544. n bytes
  545. (603)
  546.  
  547. This tag points to a Tektronix 4105 data stream. The bytes in the 
  548. data field, when read and sent to a Tektronix 4105 terminal, will 
  549. be displayed as a vector image. Only the low seven bits of each byte 
  550. are significant. Some terminal emulators will not correctly 
  551. interpret every feature of the Tektronix 4105 terminal, so you may 
  552. wish to use only a subset of the possible Tektronix 4105 vector 
  553. commands.
  554.  
  555.  
  556. Scientific Data Set Tags
  557.  
  558. SDG
  559. Scientific data group
  560. n*4 bytes
  561. (700)
  562.  
  563. The scientific data group (SDG) data is a list of data identifiers 
  564. (tag/ref) that describe a scientific data set. All of the members of 
  565. the group provide information for correctly interpreting and 
  566. displaying the data. Application programs that deal with SDGs 
  567. should read all of the elements of a SDG and process those 
  568. identifiers which it can use. Even if an application cannot process 
  569. all of the tags, the tags that it can use will be displayable.
  570.  
  571. Tag types that may appear in a SDG are listed in Table A.8.
  572.  
  573. Figure A.8    Possible Tag Types 
  574. in an SDG
  575. Tag    Description
  576. SDD    scientific data dimension record (rank and 
  577. dimensions)
  578. SD    scientific data
  579. SDS    scales
  580. SDL    labels
  581. SDU    units
  582. SDF    formats
  583. SDM    maximum and minimum values
  584. SDC    coordinate system
  585. SDT    transposition
  586.  
  587.  
  588. Example
  589. SDD, SD, SDM
  590. A dimension record, the scientific data, and the maximum and 
  591. minimum values of the data go together. The application reads the 
  592. rank and dimensions from the dimension record, then reads the 
  593. data array with those dimensions. If it needs maximum and 
  594. minimum, it also reads them.
  595.  
  596.  
  597. SDD
  598. Scientific data dimension record
  599. 16 + 4*rank bytes 
  600. (701)
  601.  
  602. This record defines the rank and dimensions of the array in the 
  603. scientific data set. The fields are defined as shown in Table A.9.
  604.  
  605. Table A.9    Scientific Data 
  606. Dimension Record 
  607. Fields
  608. Field    Definition
  609. Rank    16 bit integer
  610. Dimension sizes    32 bit integers
  611. Data NT (number type)    4 bytes
  612. Scale NTs    rank*4 bytes
  613.  
  614. For example, an SDD for a 500x600x3 array of floating point 
  615. numbers would have the following values and components.
  616.  
  617. Rank:  3
  618. Dimensions:  500, 600, and 3.
  619. One data NT
  620. Three scale NTs
  621.  
  622.  
  623. SD
  624. Scientific data
  625. 4*x*y*z*... bytes (x, y, z, etc. are the dimensions)
  626. (702)
  627.  
  628. This tag points to an array of scientific data. The type of the data 
  629. may be specified by an NT tag included with the SDG. If there is no 
  630. NT tag, the type of the data is floating point in standard IEEE 32-bit 
  631. format. The rank and dimensions must be stored as specified in 
  632. the corresponding SDD tag.
  633.  
  634.  
  635. SDS
  636. Scientific data scales
  637. n+4*(x+1+y+1+z+1+...) bytes
  638. (703)
  639.  
  640. This tag points to the scales for the data set. The first n bytes 
  641. indicate whether there is a scale for the corresponding dimension 
  642. (1=yes, 0=no). This is followed by the scale values for each 
  643. dimension.
  644.  
  645.  
  646. SDL
  647. Scientific data labels
  648. ? bytes
  649. (704)
  650.  
  651. This tag points to a list of labels for the data and each dimension of 
  652. the data set. Each label is a string terminated by a null byte.
  653.  
  654.  
  655. SDU
  656. Scientific data units
  657. ? bytes
  658. (705)
  659.  
  660. This tag points to a list of strings specifying the units for the data 
  661. and each dimension of the data set. Each unit's string is 
  662. terminated by a null byte.
  663.  
  664.  
  665. SDF
  666. Scientific data format
  667. ? bytes
  668. (706)
  669.  
  670. This tag points to a list of strings specifying an output format for 
  671. the data and each dimension of the data set. Each format string is 
  672. terminated by a null byte.
  673.  
  674.  
  675. SDM
  676. Scientific data max/min
  677. 8 bytes
  678. (707)
  679.  
  680. This record contains the maximum and minimum data values in 
  681. the data set. It consists of two floating point numbers. 
  682.  
  683.  
  684. SDC
  685. Scientific data coordinates
  686. ? bytes
  687. (708)
  688.  
  689. This tag points to a string specifying the coordinate system for the 
  690. data set. The string is terminated by a null byte.
  691. SDT
  692. Scientific data transpose
  693. 0 bytes
  694. (709)
  695.  
  696. The presence of this tag indicates that the data pointed to by the SD 
  697. tag is in column-major order, instead of the default row-major 
  698. order. No data is associated with this tag.
  699.  
  700. A.1    NCSA HDF Specifications
  701.  
  702. NCSA HDF Tags    A.1
  703.  
  704. National Center for Supercomputing Applications
  705.  
  706. March 1989
  707.  
  708.                                                                 
  709.  
  710. February 1989
  711.  
  712.  
  713.